Imports MbUnit.Framework
Imports QS = AppliedRecognition.Speech.QuickSwitch



<TestFixture("Test XML speech config")> _
Public Class XMLConfigTest
    Dim u As New Util

    <Test()> _
    Sub LoadConfig11()
        Dim c As New QS.QuickSwitchConfig
        Dim scs As QS.serialization.SpeechCommandSet = c.SpeechConfig()
    End Sub

    <TestFixtureSetUp(), TestFixtureTearDown()> _
    Sub Setup()
        Dim c As New QS.QuickSwitchConfig
        Dim f As String = IO.Path.Combine(c.DataPath, "SpeechCommands.xml")
        If IO.File.Exists(f) Then
            IO.File.Delete(f)
        End If
    End Sub

    <Test(), ExpectedExceptionAttribute(GetType(QS.QuickSwitchInvalidConfigFileException))> _
    Sub TestBadSpeechCommandName()
        Dim c As New QS.QuickSwitchConfig
        c.DataPath = IO.Path.GetTempPath
        u.WriteConfigFileToDir("SpeechCommandsBadName.xml", IO.Path.Combine(c.DataPath, "SpeechCommands.xml"))
        Dim scs As QS.serialization.SpeechCommandSet = c.SpeechConfig()
    End Sub

    <Test(), ExpectedExceptionAttribute(GetType(QS.QuickSwitchInvalidConfigFileException))> _
    Sub FailConfig10()
        Dim c As New QS.QuickSwitchConfig
        u.WriteConfigFileToDir("SpeechCommands10.xml", IO.Path.Combine(c.DataPath, "SpeechCommands.xml"))
        Dim scs As QS.serialization.SpeechCommandSet = c.SpeechConfig()
    End Sub


End Class
